//package com.cgtu.cgtucalculator.controller;
//
//
//import com.cgtu.cgtucalculator.dto.Result;
//import com.cgtu.cgtucalculator.util.CanCountable;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.*;
//@Slf4j
//@RestController
//@RequestMapping("/calculate/standard")
//@CrossOrigin
//public class Standard {
//    @PostMapping
//    public Result standardCount(@RequestBody String str){
//        CanCountable canCountable=new CanCountable();
//        Result<Double> result=new Result<>();
//        log.info(str);
//        try {
//            if(!canCountable.isErrorStr(str)){
//                Double res=canCountable.getResult();
//                log.info(str+"返回结果:{}！",res);
//
//                return result.ok().setMessage("表达式无误！").setData(res);
//            }
//        } catch (Exception e) {
//            return result.error().setMessage(e.getMessage());
//        }
//        return result.error().setMessage("表达式格式错误");
//    }
//
//
//}
